package MobileApplicationDeveloper.diagram.part;

import java.util.Collections;
import java.util.List;

import org.eclipse.gef.Tool;
import org.eclipse.gef.palette.PaletteContainer;
import org.eclipse.gef.palette.PaletteGroup;
import org.eclipse.gef.palette.PaletteRoot;
import org.eclipse.gef.palette.ToolEntry;
import org.eclipse.gmf.runtime.diagram.ui.tools.UnspecifiedTypeConnectionTool;
import org.eclipse.gmf.runtime.diagram.ui.tools.UnspecifiedTypeCreationTool;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;

/**
 * @generated
 */
public class MobileApplicationDeveloperPaletteFactory {

	/**
	 * @generated
	 */
	public void fillPalette(PaletteRoot paletteRoot) {
		paletteRoot.add(createMobileApplicationDeveloper1Group());
	}

	/**
	 * Creates "MobileApplicationDeveloper" palette tool group
	 * @generated
	 */
	private PaletteContainer createMobileApplicationDeveloper1Group() {
		PaletteGroup paletteContainer = new PaletteGroup(
				MobileApplicationDeveloper.diagram.part.Messages.MobileApplicationDeveloper1Group_title);
		paletteContainer.setId("createMobileApplicationDeveloper1Group"); //$NON-NLS-1$
		paletteContainer.add(createSetting1CreationTool());
		paletteContainer.add(createView2CreationTool());
		paletteContainer.add(createAppMobile3CreationTool());
		paletteContainer.add(createInput4CreationTool());
		paletteContainer.add(createComponentComponentEvents5CreationTool());
		paletteContainer.add(createImage6CreationTool());
		paletteContainer.add(createComponentComponentEvents27CreationTool());
		paletteContainer.add(createLabel8CreationTool());
		paletteContainer.add(createComponentComponentEvents39CreationTool());
		paletteContainer.add(createList10CreationTool());
		paletteContainer.add(createComponentComponentEvents411CreationTool());
		return paletteContainer;
	}

	/**
	 * @generated
	 */
	private ToolEntry createSetting1CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				MobileApplicationDeveloper.diagram.part.Messages.Setting1CreationTool_title,
				MobileApplicationDeveloper.diagram.part.Messages.Setting1CreationTool_desc,
				Collections
						.singletonList(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes.Label_2001));
		entry.setId("createSetting1CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes
				.getImageDescriptor(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes.Label_2001));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createView2CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				MobileApplicationDeveloper.diagram.part.Messages.View2CreationTool_title,
				MobileApplicationDeveloper.diagram.part.Messages.View2CreationTool_desc,
				Collections
						.singletonList(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes.View_2002));
		entry.setId("createView2CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes
				.getImageDescriptor(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes.View_2002));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createAppMobile3CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				MobileApplicationDeveloper.diagram.part.Messages.AppMobile3CreationTool_title,
				MobileApplicationDeveloper.diagram.part.Messages.AppMobile3CreationTool_desc,
				Collections
						.singletonList(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes.AppMobile_2003));
		entry.setId("createAppMobile3CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes
				.getImageDescriptor(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes.AppMobile_2003));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createInput4CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				MobileApplicationDeveloper.diagram.part.Messages.Input4CreationTool_title,
				MobileApplicationDeveloper.diagram.part.Messages.Input4CreationTool_desc,
				Collections
						.singletonList(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes.Input_2004));
		entry.setId("createInput4CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes
				.getImageDescriptor(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes.Input_2004));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createComponentComponentEvents5CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				MobileApplicationDeveloper.diagram.part.Messages.ComponentComponentEvents5CreationTool_title,
				MobileApplicationDeveloper.diagram.part.Messages.ComponentComponentEvents5CreationTool_desc,
				Collections
						.singletonList(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes.List_2005));
		entry.setId("createComponentComponentEvents5CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes
				.getImageDescriptor(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes.List_2005));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createImage6CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				MobileApplicationDeveloper.diagram.part.Messages.Image6CreationTool_title,
				MobileApplicationDeveloper.diagram.part.Messages.Image6CreationTool_desc,
				Collections
						.singletonList(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes.Setting_2006));
		entry.setId("createImage6CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes
				.getImageDescriptor(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes.Setting_2006));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createComponentComponentEvents27CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				MobileApplicationDeveloper.diagram.part.Messages.ComponentComponentEvents27CreationTool_title,
				MobileApplicationDeveloper.diagram.part.Messages.ComponentComponentEvents27CreationTool_desc,
				Collections
						.singletonList(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes.Image_2007));
		entry.setId("createComponentComponentEvents27CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes
				.getImageDescriptor(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes.Image_2007));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createLabel8CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				MobileApplicationDeveloper.diagram.part.Messages.Label8CreationTool_title,
				MobileApplicationDeveloper.diagram.part.Messages.Label8CreationTool_desc,
				Collections
						.singletonList(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes.ViewViewEvents_4001));
		entry.setId("createLabel8CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes
				.getImageDescriptor(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes.ViewViewEvents_4001));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createComponentComponentEvents39CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				MobileApplicationDeveloper.diagram.part.Messages.ComponentComponentEvents39CreationTool_title,
				MobileApplicationDeveloper.diagram.part.Messages.ComponentComponentEvents39CreationTool_desc,
				Collections
						.singletonList(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes.AppMobileMainView_4002));
		entry.setId("createComponentComponentEvents39CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes
				.getImageDescriptor(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes.AppMobileMainView_4002));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createList10CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				MobileApplicationDeveloper.diagram.part.Messages.List10CreationTool_title,
				MobileApplicationDeveloper.diagram.part.Messages.List10CreationTool_desc,
				Collections
						.singletonList(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes.ComponentComponentEvents_4003));
		entry.setId("createList10CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes
				.getImageDescriptor(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes.ComponentComponentEvents_4003));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createComponentComponentEvents411CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				MobileApplicationDeveloper.diagram.part.Messages.ComponentComponentEvents411CreationTool_title,
				MobileApplicationDeveloper.diagram.part.Messages.ComponentComponentEvents411CreationTool_desc,
				Collections
						.singletonList(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes.ViewViewSetting_4004));
		entry.setId("createComponentComponentEvents411CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes
				.getImageDescriptor(MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes.ViewViewSetting_4004));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private static class NodeToolEntry extends ToolEntry {

		/**
		 * @generated
		 */
		private final List<IElementType> elementTypes;

		/**
		 * @generated
		 */
		private NodeToolEntry(String title, String description,
				List<IElementType> elementTypes) {
			super(title, description, null, null);
			this.elementTypes = elementTypes;
		}

		/**
		 * @generated
		 */
		public Tool createTool() {
			Tool tool = new UnspecifiedTypeCreationTool(elementTypes);
			tool.setProperties(getToolProperties());
			return tool;
		}
	}

	/**
	 * @generated
	 */
	private static class LinkToolEntry extends ToolEntry {

		/**
		 * @generated
		 */
		private final List<IElementType> relationshipTypes;

		/**
		 * @generated
		 */
		private LinkToolEntry(String title, String description,
				List<IElementType> relationshipTypes) {
			super(title, description, null, null);
			this.relationshipTypes = relationshipTypes;
		}

		/**
		 * @generated
		 */
		public Tool createTool() {
			Tool tool = new UnspecifiedTypeConnectionTool(relationshipTypes);
			tool.setProperties(getToolProperties());
			return tool;
		}
	}
}
